package com.ruoyi.enterprise.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.enterprise.mapper.SewagePermitMapper;
import com.ruoyi.enterprise.domain.SewagePermit;
import com.ruoyi.enterprise.service.ISewagePermitService;

/**
 * 排污许可证Service业务层处理
 * 
 * @author yxf
 * @date 2021-09-14
 */
@Service
public class SewagePermitServiceImpl implements ISewagePermitService 
{
    @Autowired
    private SewagePermitMapper sewagePermitMapper;

    /**
     * 查询排污许可证
     * 
     * @param swId 排污许可证ID
     * @return 排污许可证
     */
    @Override
    public SewagePermit selectSewagePermitById(Long swId)
    {
        return sewagePermitMapper.selectSewagePermitById(swId);
    }

    /**
     * 查询排污许可证列表
     * 
     * @param sewagePermit 排污许可证
     * @return 排污许可证
     */
    @Override
    public List<SewagePermit> selectSewagePermitList(SewagePermit sewagePermit)
    {
        return sewagePermitMapper.selectSewagePermitList(sewagePermit);
    }

    /**
     * 新增排污许可证
     * 
     * @param sewagePermit 排污许可证
     * @return 结果
     */
    @Override
    public int insertSewagePermit(SewagePermit sewagePermit)
    {
        sewagePermit.setCreateTime(DateUtils.getNowDate());
        return sewagePermitMapper.insertSewagePermit(sewagePermit);
    }

    /**
     * 修改排污许可证
     * 
     * @param sewagePermit 排污许可证
     * @return 结果
     */
    @Override
    public int updateSewagePermit(SewagePermit sewagePermit)
    {
        sewagePermit.setUpdateTime(DateUtils.getNowDate());
        return sewagePermitMapper.updateSewagePermit(sewagePermit);
    }

    /**
     * 批量删除排污许可证
     * 
     * @param swIds 需要删除的排污许可证ID
     * @return 结果
     */
    @Override
    public int deleteSewagePermitByIds(Long[] swIds)
    {
        return sewagePermitMapper.deleteSewagePermitByIds(swIds);
    }

    /**
     * 删除排污许可证信息
     * 
     * @param swId 排污许可证ID
     * @return 结果
     */
    @Override
    public int deleteSewagePermitById(Long swId)
    {
        return sewagePermitMapper.deleteSewagePermitById(swId);
    }
}
